<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="commonheader">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title th:text="${commonSite.sub_title+'-'+commonSite.title}"></title>
    <meta name="description" th:content="${commonSite.content}" />
    <meta name="keywords" th:content="${commonSite.keyword}" />
    <meta name="referrer" content="no-referrer"/>
    <link rel="stylesheet" th:href="@{~/element-ui/theme-chalk/index.css}">
    <link rel="stylesheet" th:href="@{~/css/css.css}">
    <link rel="icon" type="images/x-ico" th:href="@{~/images/favicon.ico}"/>
    <style>
        body {
            margin: 0;
        }
        [v-cloak] {
            display: none;
        }

        .publicarea .headnav .active a {
            border-bottom: 2px solid #0084c9;
            color: #0084c9;
        }
        .top-nav{
            position: fixed;
            border-bottom: 1px solid #e6e6e6;
            height: 78px;
            z-index: 999;
            top: 0;
            background: rgba(255,255,255, .7);
        }
        .main-page-box{
            margin-top: 100px;
        }
        .headnav ul {
            white-space: nowrap;
            overflow: auto; /* 或 overflow: scroll; */
        }
    </style>

    <script th:src="@{~/js/vue2.js}"></script>
    <script th:src="@{~/element-ui/index.js}"></script>
    <script th:src="@{~/js/jquery3.6.js}"></script>

    <script>
        function IsPC() {
            var userAgentInfo = navigator.userAgent; // 包含有关浏览器的信息
            // 非手机端
            var Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"];
            var flag = true;
            for (var v = 0; v < Agents.length; v++) {
                if (userAgentInfo.indexOf(Agents[v]) > 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }

        if (!IsPC()){
            var url = new URL(window.location.href);
            var path = url.pathname;

            const regex = /^\/new\/(\d+)\.html$/;

        // console.log(path)
        //     console.log(regex.test(path))

            let href = 'http://m.xatianzhou.com/';
            if (regex.test(path)){
                const match = path.match(regex);
                const number = match ? match[1] : null;
                href = 'http://m.xatianzhou.com/#/pages/new/newDetail?id='+number;
            }
            location.href = href;
        }


    </script>

</head>
<body>


<div th:fragment="commonnav">
    <div id="headerDom" >
<!--        <div class="top site-nav">-->
<!--            <div class="site-nav-bd publicarea">-->
<!--                <ul class="site-nav-area">-->
<!--                    <li>029-85212477&nbsp;&nbsp;|</li>-->
<!--                    <li><a href="/sitemap.xml" target="_self">网站地图</a></li>-->
<!--                    <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=228829768&amp;site=qq&amp;menu=yes" target="_blank">-->
<!--                        <li class="talk">-->
<!--                        </li>-->
<!--                    </a>-->
<!--                </ul>-->
<!--            </div>-->
<!--        </div>-->

        <div class="top top-nav">
            <div class="publicarea"  style="display:flex;justify-content: space-around;">
                <img th:src="${commonSite.logo}" alt="" class="logo">
                <ul class="headnav" style="white-space: nowrap;overflow: hidden;display: flex">
                    <li th:class="${commonUri == '/'} ? 'active' : ''"><a  href="/">首页</a></li>
                    <li th:each="column,columnId:${commonColumns}" th:class="${'/'+column.url == commonUri || commonUri == '/video-2' && column.url.contains('video-2')}  ? 'active' : ''"><a  th:href="'/'+${column.url}" th:text="${column.name}" th:title="${column.name}"></a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>